﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Common
{
    /// <summary>
    /// 实现INotifyPropertyChanged
    /// </summary>
    [Serializable]
    public class NotifyBase : INotifyPropertyChanged
    {
        /// <summary>
        /// 改变执行委托
        /// </summary>
        [field: NonSerialized()]
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// 调用通知
        /// </summary>
        /// <param name="propName"> </param>
        public void DoNotify([CallerMemberName] string propName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
        }
    }
}